<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<?php
echo "<h1>删除界面</h1>";
if(!isset($_GET["id"])){
    echo "没有参数ID";
}
$id = $_GET["id"];
try{
    $pdo = new PDO("mysql:dbname=liu;host=127.0.0.1","root","");
    $pdo->exec("SET NAMES 'utf8'");
    $sql = "DELETE FROM log_user WHERE log_id = $id;";
    $res = $pdo->exec($sql);
}catch (PDOException $e){
    echo "错误信息：".$e->getMessage();
}
if($res > 0){
    echo "删除成功<br>请等待3秒，将自动转换页面<br>";
    echo '<meta http-equiv="refresh" content="3;url=tb_print.php">';
}else{
    echo "删除失败<br>";
}
